package C10_9_IntroduceParameterObject.after_refactor;

import java.util.Date;

/**
 * 范围对象
 */
public class DateRange {
    private final Date _start;
    private final Date _end;
    DateRange(Date start, Date end) {
        _start = start;
        _end = end;
    }
    Date getStart() {
        return _start;
    }
    Date getEnd() {
        return _end;
    }
    public boolean includes(Date arg) {
        return arg.equals(_start) || arg.equals(_end) ||
                (arg.after(_start) && arg.before(_end));

    }
}
